from flask import Flask, render_template
from flask_restful import Api

from learning_info.flask_restful.flask_restful_demo import Todo, TodoList

app = Flask(__name__)
api = Api(app)


@app.route('/')
def hello_ai_crowdsourcing():
    return 'Hello AI Crowdsourcing!'


@app.route('/hello')
def hello_js_test():
    return render_template("hello.html")


# Actually setup the Api resource routing here
api.add_resource(TodoList, '/todos')
api.add_resource(Todo, '/todos/<todo_id>')

if __name__ == '__main__':
    app.run(debug=True)
